/***************************************************************************************\
			GLOBAL
\***************************************************************************************/

func void STARTUP_GLOBAL()
{
	Game_InitGerman();
};

func void INIT_GLOBAL()
{
	Game_InitGerman();
	MEM_InitAll();
	MEM_SetShowDebug(1);
	
	LeGo_Init(LeGo_All & ~LeGo_Bloodsplats);
	
	MoreAlphaVobs(2048); //normal: 256
    MoreAlphaPolys(16384); //normal: 2048
    
    MEM_WriteInt(SPAWN_INSERTRANGE_Address, mkf(90000));
	MEM_WriteInt(SPAWN_REMOVERANGE_Address, mkf(95000));
	
	MEM_Game.showPlayerStatus = 1;
	
	var int resX; resX = STR_ToInt(MEM_GetGothOpt("VIDEO", "zVidResFullscreenX"));
	var int resY; resY = STR_ToInt(MEM_GetGothOpt("VIDEO", "zVidResFullscreenY"));
	var int resX_s_F; resX_s_F = resX - (31 * 10);
	VideoHD = ((resX>=1280)&&(resY>=768));
	if(VideoHD) { VideoAdd = ".bik"; }
	else        { VideoAdd = ".bik"; };
	ProzentAngabeRechts = (resX_s_F*100)/resX;
	
	Timer_SetPauseInMenu(TRUE);
};

/***************************************************************************************\
			MAP
\***************************************************************************************/

func void SpawnHelperNpcs()
{	
	MEM_InitAll();
	MEM_SetShowDebug(1);
	
	LeGo_Init(LeGo_All & ~LeGo_Bloodsplats);
	
	Wld_InsertNpc (PAL_1000_King,SpawnWaypoint);
	Wld_InsertNpc (NONE_1001_SchmiedeBauer,SpawnWaypoint);
	Wld_InsertNpc (NONE_1005_MagieBauer,SpawnWaypoint);
	Wld_InsertNpc (NONE_1006_MineBauer,SpawnWaypoint);
	Wld_InsertNpc (NONE_1003_Verwalter,SpawnWaypoint);
	Wld_InsertNpc (NONE_1011_Elite,SpawnWaypoint);
	Wld_InsertNpc (NONE_1013_Dealer, SpawnWaypoint);

	Wld_InsertNpc (DJG_2000_King,SpawnWaypoint);
	
	FF_ApplyOnceExt(EVT_Perframe,0,-1);
	FF_ApplyOnceExt(DF_LoopFunc,1000,-1);
	B_EarlyGamestart();
	FF_ApplyExt(B_GAMESTART,1000,1);
};

func void STARTUP_Map ()
{
	SpawnHelperNpcs();
	
	Map = Map01;
};

func void INIT_Map ()
{
	B_InitMonsterAttitudes ();
	B_InitGuildAttitudes();
	B_InitNpcGlobals ();
};

/***************************************************************************************\
			MACHTL MAP
\***************************************************************************************/

func void STARTUP_Machtl_Map ()
{
	SpawnHelperNpcs();
	
	Map = Machtl_Map;
};

func void INIT_Machtl_Map ()
{
	B_InitMonsterAttitudes ();
	B_InitGuildAttitudes();
	B_InitNpcGlobals ();
};

/***************************************************************************************\
			CHANGEROOM
\***************************************************************************************/

func void STARTUP_CHANGEROOM ()
{	
	Wld_InsertNpc (VLK_666_Spielleiter,SpawnWaypoint);
	
	Wld_InsertNpc (OP_Xardas,   "XARDAS"    );
	Wld_InsertNpc (OP_Angar,    "COR_ANGAR" );
	Wld_InsertNpc (OP_Lee,      "LEE"       );
	Wld_InsertNpc (OP_Hagen,    "LORD_HAGEN");
	Wld_InsertNpc (OP_Thief,    "DIEGO"     );
	Wld_InsertNpc (OP_Mage,     "MILTEN"    );
	Wld_InsertNpc (OP_Psionic,  "LESTER"    );
	Wld_InsertNpc (OP_Fighter,  "GORN"      );
	Wld_InsertNpc (OP_Mud,      "MUD"       );
	Wld_InsertNpc (OP_Gomez,    "GOMEZ"     );
	Wld_InsertNpc (OP_Lares,    "LARES"     );
	Wld_InsertNpc (OP_Raven,    "RAVEN"     );
	Wld_InsertNpc (OP_YBerion,  "BAAL_LUKOR");
	Wld_InsertNpc (OP_Wulfgar,  "WULFGAR"   );
	Wld_InsertNpc (OP_Thorus,	"THORUS"    );
};
func void INIT_CHANGEROOM ()
{
	B_InitMonsterAttitudes ();
	B_InitGuildAttitudes();
	B_InitNpcGlobals ();
};

/***************************************************************************************\
			VARUS MAP
\***************************************************************************************/

func void STARTUP_VarusMap ()
{
	SpawnHelperNpcs();
	
	Wld_InsertNpc (CaveSkeleton,"HOEHLE");
	Wld_InsertNpc (CaveSkeleton,"L2_WARGHOEHLE_22");
	Wld_InsertNpc (CaveSkeleton,"L1_WARGHOEHLE_16");
	
	Map = Varus_Map;
};
func void INIT_VarusMap ()
{
	B_InitMonsterAttitudes ();
	B_InitGuildAttitudes();
	B_InitNpcGlobals ();
};

